<!--
页面代码高亮实现:
使用[prismjs](https://prismjs.com/index.html)
第一步：npm install prismjs
第二步：import Prismjs from 'prismjs'以及引入样式import 'prismjs/theme/prismjs.min.css'
第三步：使用<pre><code class="language-xxx">这里放代码</code></pre>，xxx是代码语音类型。可能存在初始化不渲染的bug，建议
后渲染。
 -->
<template>
  <div>
    css:<br>
    <pre><code class="language language-css" contenteditable="true" v-text="cssCode"></code></pre>
    <br>
    json:<br>
    <pre><code class="language language-json" contenteditable="true" v-text="jsonCode"></code></pre>
  </div>
</template>

<script>
  import Prismjs from 'prismjs';
  import 'prismjs/themes/prism.min.css'
  export default {
    name: "highlight",
    data() {
      return {
        cssCode: 'p{color: red}',
        jsonCode: {
          name: 'clw',
          id: 1
        }
      }
    }
  }
</script>

<style scoped>

</style>
